package coumo.jdbc.driver;

import java.sql.SQLException;

import coumo.jdbc.driver.COUMOErrorCode;
import coumo.jdbc.jci.UError;

public class COUMOException extends SQLException
{

  protected COUMOException(String msg, int errCode)
  {
    super(msg, null, errCode);
  }

  public COUMOException(UError error)
  {
    this(error.getErrorMsg(), error.getJdbcErrorCode());
  }

  public COUMOException(int errCode)
  {
    this(COUMOErrorCode.getMessage(errCode), UError.DRIVER_ERROR_CODE_BASE
        - errCode);
  }

  public COUMOException(int errCode, String msg)
  {
    this(COUMOErrorCode.getMessage(errCode) + msg,
        UError.DRIVER_ERROR_CODE_BASE - errCode);
  }
}
